﻿<?php
$dis_id=3;
include("../../inc/conn.inc");
include("../islogin2.php");
$url="hot_pro.php";
$thepage=$_GET['page']?$_GET['page']:1;
$maxpage=15;


	$m_rs=mysql_query("select m_type from member where id='".$_COOKIE['user_id']."'");
	$m_row=mysql_fetch_array($m_rs);
	$type=$m_row['m_type'];




if($_GET[re_act]){
$urls=$_SERVER['HTTP_REFERER'];
if($type==3){
$limit_sql=" order by id desc limit 10";
}

mysql_query("update hot_pro set p_addtime='".date("Y-m-d H:i:s")."',m_type='$type'  where member_id='".$_COOKIE['user_id']."'".$limit_sql);


echo "<script>location='".$urls."'</script>";
}
?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 供应信息 &gt;&gt; 热门产品管理</span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">

<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">热门产品管理(
     	<a href="hot_pro_fresh.php?fresh=all">刷新所有产品</a>
     )</TD>
   </TR>
</TABLE>
<br>

<table width="100%" cellspacing="1" bgcolor="#C1DCF5">
        <tr>
          <td width="5%" height="30" align="center" bgcolor="#EFF6FF">编号</td>
          <td width="15%" align="center" bgcolor="#EFF6FF">图片</td>
          <td width="35%" align="center" bgcolor="#EFF6FF">产品名称</td>
          <td width="15%" align="center" bgcolor="#EFF6FF">发布时间</td>
          <td width="10%" align="center" bgcolor="#EFF6FF">状态</td>
          <td width="20%" align="center" bgcolor="#EFF6FF">管理操作</td>
        </tr>
<?php
if($m_row['m_type']==6){
$sql="select id,picture,p_title,p_addtime,p_cl,p_sh from hot_pro where member_id='".$_COOKIE['user_id']."' order by id desc limit ".($thepage-1)*$maxpage.",$maxpage";
}else{
$sql="select id,picture,p_title,p_addtime,p_cl,p_sh from hot_pro where member_id='".$_COOKIE['user_id']."' order by id desc limit 10";
}
$rs=mysql_query($sql);
$i=1;
while($row=mysql_fetch_array($rs)){
?>
        <tr>
          <td height="22" align="center" bgcolor="#FFFFFF"><?=$i?></td>
          <td align="center" bgcolor="#FFFFFF"><?php if($row[picture]){?><img src="http://img.sandib2b.cn/<?=$row[picture]?>" width="60" height="60" border="0"><?php }else{?><img src="/member/images/no_photo.gif" width="60" height="60" border="0"><?php }?></td>
          <td align="left" bgcolor="#FFFFFF"><?=$row[p_title]?></td>
          <td align="center" bgcolor="#FFFFFF"><?php if($row[p_addtime]>=date("Y-m-d")){?><font color="#FF0000"><?=date("Y-m-d",strtotime($row[p_addtime]))?></font><?php }else{?><?=date("Y-m-d",strtotime($row[p_addtime]))?><?php }?></td>
          <td align="center" bgcolor="#FFFFFF"><?php if($row[p_cl]==1){?><?php if($row[p_sh]==1){echo "正常";}else if($row[p_sh]==2){echo "<font color='red'>未通过</font><br>(请正确选择产品目录)";}else{echo "<font color='red'>未通过</font>";}?><?php }else{echo "审核中";}?></td>
          <td align="center" bgcolor="#FFFFFF">&nbsp;&nbsp;<a href="hot_pro_edit.php?xg_id=<?=$row['id']?>">修改</a>&nbsp;&nbsp;<a href="/hot/<?=$row['id']?>.html" target="_blank">预览</a><!--&nbsp;&nbsp;<a href="<?//=$url?>?del_act=ok&amp;del_id=<?//=$row['id']?>" onClick="return del()">删除</a><--></td>
        </tr>
<?php

$i++;
}?>
<?php
$rs2=@mysql_query("select count(id) from hot_pro where member_id='".$_COOKIE['user_id']."'");
$totalrecord=@mysql_result($rs2,0);
$totalpage=ceil($totalrecord/$maxpage);
@mysql_free_result($rs2);
  
if($totalpage>0){
?>
        <tr>
          <td colspan="6" align="center" bgcolor="#FFFFFF" height="18"><script language="javascript">
<!--
function showPageLink(sUrl,iPage,iCount){
	var i;
	i=Math.max(1,iPage-1);
	document.write("<a href=\"" + sUrl + "1\">«</a> ");
	document.write("<a href=\"" + sUrl + i + "\">上一页</a> ");
	for(i=Math.max(1,iPage-8);i<iPage;i++){
		document.write("<a href=\""+sUrl + i + "\"><b>" + i + "</b></a> ");
	}
	document.write("<font color='#ff3333'><b>" + iPage + "</b></font> ");
	for(i=iPage+1;i<=Math.min(iCount,iPage+8);i++){
		document.write("<a href=\""+sUrl + i + "\"><b>" + i + "</b></a> ");
	}
	i=Math.min(iCount,iPage+1);
	if(iCount>iPage+8) document.write("<span style='font-size:8px'>···</span> ");
	document.write("<a href=\"" + sUrl + i + "\">下一页</a> ");
	document.write("<a href=\"" + sUrl + iCount + "\">»</a> ");
}
showPageLink("<?=$url?>?page=",<?=$thepage?>,<?=$totalpage?>);
//-->
</script></td>
        </tr><?php }?>
    </table>

</div>
<div class="onl"></div>
<?php include("../inc/foot.php");?>
</div>
</body>
</html>
<script language="javascript">
function del(){
if(confirm("确定要删除该信息!"))
return true;
else
return false;
}
</script>
